import { get, getBuffer, postJson, postFile, del } from "../http";
import { query } from "../weeon/room";
let api = process.env.VUE_APP_API;
if (process.env.VUE_APP_Mock === "true") {
  api = "/mock/";
}

// 获取项目列表
export const listUnfinishedBid =  (p) =>  postJson(`${api}/witness/track/listUnfinishedBid`, p);

// 区域房间结构
export const dvListAreaRoom =  () =>  get(`${api}/witness/dv/listAreaRoom`);
// 获取设备列表
export const dvGetPreviewURLs=  (query) =>  get(`${api}/witness/dv/getPreviewURLs`,query);

// 获取当前预警列表
// {
//     "bidIds": [
//     ],
//     "personType": "",
//     "status": 1
// }

export const trackListAlarm=  (p) =>  postJson(`${api}/witness/track/listAlarm`,p);

// 获取预警详情


export const gtrackGetAlarm=  (id) =>  get(`${api}/witness/track/getAlarm/${id}`);
// 处理预警


// {
//     "id": "",
//     "status": 1,
//     "content": ""
// }
export const handleAlarm=  (data) =>  postJson(`${api}/witness/track/handleAlarm`,data);

// 获取回放地址


export const getAlarmPlaybackURLs=  (data) =>  postJson(`${api}/witness/track/getAlarmPlaybackURLs`,data);

// 人数统计

export const personCount=  () =>  get(`${api}/witness/track/personCount`);